package com.winbomb.kingcard.screens;

import com.winbomb.kingcard.Assets;
import com.winbomb.kingcard.framework.Game;
import com.winbomb.kingcard.framework.Pixmap;
import com.winbomb.kingcard.framework.Screen;
import com.winbomb.kingcard.framework.Input.TouchEvent;

public class BattleHelpScreen extends Screen {

	private static final int STEP_NUM = 6;
	private int stepNum = 1;

	private static final Pixmap[] steps = new Pixmap[] { Assets.h2_s1, Assets.h2_s2, Assets.h2_s3, Assets.h2_s4,
			Assets.h2_s5, Assets.h2_s6 };

	public BattleHelpScreen(Game game) {
		super(game);
	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub

	}

	@Override
	public void pause() {
		// TODO Auto-generated method stub

	}

	@Override
	public void present(float deltaTime) {
		// draw background
		g.drawPixmap(Assets.h2_bg1, 0, 0);
		if (stepNum != 6) {
			g.drawPixmap(Assets.h2_bg2, 0, 0);
		}

		g.drawPixmap(steps[stepNum - 1], 0, 0);
	}

	@Override
	public void resume() {
		// TODO Auto-generated method stub

	}

	@Override
	public void update(float deltaTime) {
		updateTouchEvents();

		for (TouchEvent event : touchEvents) {
			if (event.type != TouchEvent.TOUCH_UP) {
				continue;
			}

			// 结束

			if (stepNum < STEP_NUM) {
				stepNum++;
			} else {
				game.setScreen(new MainScreen(game));
			}
		}
	}

}
